Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing /
Chapter 2 - Core Printing Features / Core Printing Features Reference
Application-Defined Functions / Flattening and Unflattening Functions for Job Objects


MyFlattenFunction

To save a job object when a user saves a printable document, provide a pointer to an application-supplied flattening function in the GXFlattenJob function. The application-supplied function must match the following declaration. For example, this is how you should declare the function if you were to name it MyFlattenFunction:

OSErr MyFlattenFunction (long size, void *data, void *refCon);
size
The size of the segment (in bytes) to write.
data
A pointer to job object data to flatten.
refCon
A pointer to a reference constant for application-specific information.
function result
An error code of type OSErr.
DESCRIPTION
When you use the GXFlattenJob function, QuickDraw GX calls your flattening function multiple times as it flattens job object data to disk. Each time it calls your function, the function should write the next segment of the job object until the entire job object is saved. You can use the refCon parameter to hold the file reference number of the file containing the data to flatten. You can return any OSErr value.

SEE ALSO
Listing 2-8 on page 2-28 shows how to use a flattening function.

The GXFlattenJob function is described on page 2-57.

To retrieve a job object that has been flattened, see the next section.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help